package com.tencent.mapper;

import com.tencent.entity.CheckGroup;
import org.apache.ibatis.annotations.*;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

public interface CheckGroupMapper {

    /**
     * 查询检查组所有
     * @return
     */
//    @Select("select * from t_checkgroup")
    public List<CheckGroup> findAll(String code);
    /**
     * 新增检查组
     * @param checkGroup
     * @return
     */
    @Insert("insert into t_checkgroup values (#{id},#{code},#{name},#{helpCode},#{sex},#{remark},#{attention})")
    public int insert(@RequestBody CheckGroup checkGroup);

    /**
     * 根据检查组id进行删除
     * @param id
     * @return
     */
    @Delete("delete from t_checkgroup where id =#{id}")
    public int deleteByCode(String id);

    /**
     * 根据检查组id进行查询
     * @param id
     * @return
     */
    @Select("select * from t_checkgroup where id = #{id}")
    public CheckGroup findById(Integer id);

    /**
     * 根据id修改检查组信息
     * @param checkGroup
     * @return
     */
    @Update("update t_checkgroup set code = #{code},name = #{name},helpCode = #{helpCode}, sex = #{sex}, remark = #{remark}, attention = #{attention} where id = #{id}")
    public int updateById(CheckGroup checkGroup);


}
